import { NoSkinCellRenderer } from "../../common/item/NoSkinCellRenderer";
import { Language } from "../../../../../extend/language/Language";
import { ColorConfig } from "../../../resource/ColorConfig";
import { LRAwardItemVo } from "./info/LRAwardItemVo";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { BgItem } from "../../common/BgItem";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
type int = number;
//class LRAwardItemRenderer
    
    export  class LRAwardItemRenderer extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        /* internal  */rightNum(arg1: int, arg2: int): void
        {
            var loc1=null;
            if (this._rightNum) 
            {
                this._rightNum.text = Language.getStringByParam(27723, arg1.toString());
                loc1 = ColorConfig.instance.getItem("LRAward", arg2.toString());
                if (loc1) 
                {
                    this._rightNum.textColor = loc1.intColor;
                }
            }
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            var loc1=arg1 as LRAwardItemVo;
            if (loc1) 
            {
                this.rightNum(loc1.needRightNum, loc1.index);
                this._item.setItemCode(loc1.itemCode);
                this._item.isDragAble = false;
                if (loc1.rightNum >= loc1.needRightNum) 
                {
                    this._item.filters = [FilterConst.colorFilter2];
                }
                else 
                {
                    this._item.filters = [];
                }
            }
            return;
        }

        protected /* override */ createChildren(): void
        {
            ObjCreate.createBg(0, 0, 58, 80, this, ImagesConst.WindowCenterA);
            this._rightNum = ObjCreate.createGTextField("", 0, 7, 58, 20, this, GlobalStyle.getTextFormatCenter(GlobalStyle.textFormat1));
            this._item = new BgItem();
            ObjCreate.setObjAttri(this._item, 10, 30, -1, -1, this);
            return;
        }

        /* internal */ /* var */_rightNum: GTextFiled;

        /* internal */ /* var */_item: BgItem;
    }
